package org.agpsoft.datareceiverinfrastructure.datasource;

import org.agpsoft.datareceiverinfrastructure.common.IElementInitiator;
import org.agpsoft.datareceiverinfrastructure.exception.DataReceiverException;
import org.agpsoft.datareceiverinfrastructure.exception.DataReceiverNULLObjectException;
import org.agpsoft.datareceiverinfrastructure.facade.IDataReceiverProcessor;

/**
 * Interface for data receiver source
 * It aims to fetch data from source and record it as raw
 * @author Ali Gokalp Peker
 */
public interface IDataAccessor extends IElementInitiator {
		
	/**
	 * Requests data from source and sends data to {@link IDataReceiverProcessor} instance 
	 * must be implemented as asynchronous data access
	 * @param dataLength Data length to read data
	 * @throws DataReceiverException
	 */
	public void requestDataFromSource( int dataLength ) throws DataReceiverException;
	
	/**
	 * Setter for data receiver processor
	 * Setting a processor is useful on active data sources
	 * @param processor processor instance to set
	 * @throws DataReceiverNULLObjectException
	 */
	public void setDataProcessor( IDataReceiverProcessor processor ) throws DataReceiverNULLObjectException;
}
